import json

import requests

import kkl_config

class PHP:
    def __init__(self):
        self.url = kkl_config.URL_xhx

    def php(self,path,params):
        ffurl = self.url + path
        cookie = {"xhxtoken":kkl_config.Token.xhxtoken}
        respond = requests.post(ffurl,params=params,cookies=cookie)
        kkl_config.prints(respond)
        res = respond.json()
        print(json.dumps(res,ensure_ascii=False,indent=2))

if __name__ == "__main__":
    from scripts01.login01 import LoginApi
    LoginApi().xhxLogin()
    path = "/workbench/myclass/getteacherclasses"
    params = {
            "course_id": 105205,
            "teacher_id": 3367
        }
    PHP().php(path,params)